export default {
  data() {
    return {
      appVersion: 1
    }
  },
  onShow() {
    // #ifdef APP-PLUS
    plus.runtime.getProperty(plus.runtime.appid, wgtinfo => {
      this.appVersion = wgtinfo.version
    })
    // #endif
  },
  methods: {
    appStore() {
      // #ifdef APP-PLUS
      const data = uni.getSystemInfoSync()
      let appurl
      if (data.platform === 'android') {
        appurl='market://details?id=com.yzsheng.ztcbs.xvrotjk'
        // appurl = 'https://sj.qq.com/myapp/detail.htm?apkName=com.yzsheng.ztcbs.xvrotjk&info=ADE44958435E15B5BDD2E7690B4F7D4E'
        plus.runtime.openURL(appurl, function(res) {
				  console.log(res)
        })
      } else {
        appurl = 'itms-apps://itunes.apple.com/cn/app//id1525852184'
        plus.runtime.launchApplication({ action: appurl }, function(e) {
          console.log('Open system default browser failed: ' + e.message)
        })
      }
      //#endif
    },

    callPhone() {
      uni.makePhoneCall({
        phoneNumber: this.$store.state.user.servicePhone + '',
      })
    },
  }
}
